<?php

/**
 * school actions.
 *
 * @package    nutrition
 * @subpackage school
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class schoolActions extends sfActions
{
  public function executeIndex(sfWebRequest $request)
  {
    $q = Doctrine_Core::getTable('dynamicinfomation')->retriveSchoolsListQuery();
    $this->pager = Doctrine_Core::getTable('dynamicinfomation')->getSchoolsListPager($request->getParameter('page', 1), $q);
  }

  public function executeList(sfWebRequest $request)
  {
//    $this->category = $this->getRoute()->getObjects();
    $this->category = Doctrine_Core::getTable('category')->getCategoryById($request->getParameter('category_id',1));
    $q = $this->category->retriveSchoolsListQuery();
    $this->pager = Doctrine_Core::getTable('dynamicinfomation')->getSchoolsListPager($request->getParameter('page', 1), $q);
  }
  

  public function executeShow(sfWebRequest $request)
  {
    $this->dynamicinfomation = $this->getRoute()->getObject();
    $this->dynamicinfomation->setViews($this->dynamicinfomation->getViews() + 1);
    $this->dynamicinfomation->save();
  }

}
